﻿//ILogReceiver.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Logging
{
	/// <summary>
	/// Интерфейс получателя логов.
	/// </summary>
	public interface ILogReceiver : ILogSource
	{
		/// <summary>
		/// Записать сообщение в лог.
		/// </summary>
		/// <param name="message">Отладочное сообщение.</param>
		void AddLog(LogMessage message);
	}

	/// <summary>
	/// Базовая реализация <see cref="ILogReceiver"/>.
	/// </summary>
	/// <typeparam name="TParent">Тип родителя <see cref="ILogSource.Parent"/>.</typeparam>
	public abstract class BaseLogReceiver<TParent> : BaseLogSource<TParent>, ILogReceiver
	{
		/// <summary>
		/// Инициализировать <see cref="BaseLogReceiver{TParent}"/>.
		/// </summary>
		protected BaseLogReceiver()
		{
		}

		void ILogReceiver.AddLog(LogMessage message)
		{
			RaiseLog(message);
		}
	}
}